# Copyright 1999-2008 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: $

EAPI="2"

inherit eutils qt4 flag-o-matic
MY_PN="${PN/qutim-/}"

DESCRIPTION="ICQ protocol plugin for qutIM instant messendger"
HOMEPAGE="http://www.qutim.org"
LICENSE="GPL-2"
SRC_URI="http://www.qutim.org/uploads/src/qutim-0.2.0.tar.bz2"

SLOT="0.2"
KEYWORDS="~amd64 ~ppc ~ppc64 ~x86"
IUSE="debug"

DEPEND="net-im/qutim:0.2
	!x11-plugins/qutim-icq:live"

RESTRICT="debug? ( strip )"

S=${WORKDIR}/qutim-0.2.0/plugins/${MY_PN}

src_prepare()
{
	if (use debug) ; then
		unset CFLAGS CXXFLAGS
		append-flags -O1 -g -ggdb
	fi
}

src_compile() 
{
	eqmake4 ${MY_PN}.pro || die "Failed ICQ plugin configure"
	emake || die "Failed ICQ plugin build"
}

src_install()
{
 	insinto /usr/$(get_libdir)/qutim
 	doins "${S}/lib${MY_PN}.so" || die "Plugin installation failed"
}
